<template>
  <div>
    <el-table :data="users" stripe>
      <el-table-column prop="username" label="用户名" />
      <el-table-column prop="realname" label="真实姓名" />
      <el-table-column prop="phone" label="联系电话" />
      <el-table-column prop="email" label="邮箱" />
      <el-table-column prop="status" label="状态" />
      <el-table-column prop="role" label="角色" />
      <el-table-column label="操作">
        <template #default="scope">
          <el-button @click="$emit('edit', scope.row)" type="plain" class="text-blue-500">编辑</el-button>
          <el-button @click="$emit('delete', scope.row.id)" type="plain" class="text-red-500 ml-2">删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    <el-pagination
      class="mt-4"
      :current-page.sync="currentPage"
      :page-size="pageSize"
      :total="totalUsers"
      @current-change="$emit('page-change', $event)"
      layout="total, prev, pager, next, jumper"
    />
  </div>
</template>

<script>
export default {
  props: {
    users: Array,
    currentPage: Number,
    pageSize: Number,
    totalUsers: Number,
  },
};
</script>